export default {
  namespace: 'code',
  state:{
    code: {
      count: 60,
      isClick: false,
      modalControl:false,
      content: ''
    },
  },
  effects: {
    *getCode ( { payload }, { put }) {
      yield put( {
        type: 'changeCode',
        payload
      })
    },
    *modalControlAction ( { payload } , { put }) {
      console.log(payload)
      yield put({
        type: 'changeModal',
        payload
      })
    },
  },
  reducers: {
   // 修改验证码
    changeCode (state, { payload }) {
      return {
        ...state,
        ...payload
      }
    },
    changeModal (state, { payload }) {
      console.log(payload)
      return {
        ...state,
        code:{
          ...payload
        }
      }
    }
  }
}